
from datetime import timedelta
from celery.schedules import crontab
from app.read_conf import rabbit_user, rabbit_pwd, rabbit_host

CELERY_TIMEZONE='Asia/Shanghai'
CELERY_ENABLE_UTC=True
CELERY_IMPORTS=('app.tasks',)

BROKER_URL='amqp://%s:%s@%s:5672//' % (rabbit_user, rabbit_pwd, rabbit_host)
print('BROKER_URL:', BROKER_URL)
# CELERY_RESULT_BACKEND='amqp'
CELERY_RESULT_BACKEND = 'celery_amqp_backend.AMQPBackend://'
#CELERY_RESULT_BACKEND='db+sqlite://C:/Users/zhoufan/Desktop/result.db'

CELERYBEAT_SCHEDULE={
    'index-every-60-seconds':{
        'task': 'app.tasks.proc_every_minute',
        'schedule': timedelta(seconds=3600),
        'args': ()
    }
}
